<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body>
<div style="height: 50px"></div>
<div id="exportword_content">
    <style>
        body{overflow-x: hidden}
        .dantab{width: 90%;margin: 0 0 0 5%!important;}
        .dantab td{border-color: #000!important;text-align: center}
        .dantab tr td:nth-child(1){width: 20%}
        #dantit{text-decoration: underline;text-underline-position: under;font-weight: 700;font-size: 24px;text-align: center;padding: 20px;letter-spacing: 12px;}
        .xiahua{text-decoration: underline;text-underline-position: under;}
        .rrr{text-align: right!important;letter-spacing: 5px;}
        .qianming{max-width: 100px;max-height: 40px}
    </style>
    <table class="layui-table dantab" border="1">
        <tbody>
            <tr><td colspan="4" id="dantit"><span id="created_user_chanid_name"></span>付款申请表</td></tr>
            <tr><td colspan="4" class="rrr">本次为 <span class="xiahua" id="shenci"></span> 次申请</td></tr>
            <tr>
                <td colspan="4" style="text-align: left">
                    <span style="width: 60%;display: inline-block"> 付款事由：<span id="zhai"></span></span>
                    <span style="width: 30%;display: inline-block"> 合同编号：<span id="shi_number"></span></span>
                    <span style="float: right;"> 单位：元</span>
                </td>
            </tr>
            <tr>
                <td>申请付款单位填写</td>
                <td colspan="4" style="text-align: left">
                    <div>项目名称：<span id="engin_name"></span></div>
                    <div>合同金额：<span id="shimoney"></span></div>
                    <div>
                        <span style="width: 40%;display: inline-block">已开票金额：<span id="piao_kai_fee"></span></span>
                        <span style="width: 30%;display: inline-block"> 开票类型：<span id="kai_piaotype_name"></span></span>
                        <span> 税率：<span id="shi_rate"></span></span>
                    </div>
                    <div>已付款金额：<span id="yifufee"></span></div>
                    <div>本次申请付款数额（小写）：<span id="money"></span></div>
                    <div>
                        <span style="width: 50%;display: inline-block">本次申请付款数额（大写）：<span id="money_da"></span></span>
                        <span> 本次为第 <span id="fukuanci"></span> 次付款</span>
                    </div>
                </td>
            </tr>
            <tr><td>付款形式</td><td colspan="3" id="incdaotype" style="text-align: left"></td></tr>
            <tr><td>收款单位</td><td colspan="3" id="gonger" style="text-align: left"></td></tr>
            <tr><td>开户行及账号</td><td colspan="3" id="bankname" style="text-align: left"></td></tr>
            <tr><td>审批附件检查</td><td colspan="3" id="filesinfo" style="text-align: left"></td></tr>
            <tr>
                <td>经办人</td>
                <td colspan="4" style="text-align: left">
                    <div>
                        <span style="width: 50%;display: inline-block">经办人：<span id="flowuser"></span></span>
                        <span> 申请日期： <span id="created_at_ymd"></span></span>
                    </div>
                    <div>
                        <span style="width: 50%;display: inline-block">经办人部门：<span id="flowdept"></span></span>
                        <span> 项目部盖章：</span>
                    </div>
                </td>
            </tr>


            <tr><td colspan="4" style="font-weight: 700">审核记录</td></tr>
        </tbody>
    </table>
</div>
<div style="text-align: center;margin-top: 30px"><button class="layui-btn layui-btn-sm btn-light marginr5" style="background-color: #2272eb" onclick="print_flow_dan()">确认打印</button></div>
<script>
    var param_id = getQueryVariable('id') || 0;
    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_payment_engin_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                var shiinfo = res.data.shiinfo;

                $("#created_user_chanid_name").text(data.created_user_chanid_name);
                $("#shenci").text(data.shenci);
                $("#zhai").text(data.zhai);
                if(shiinfo){
                    $("#shi_number").text(shiinfo.number);
                }
                if(engininfo){
                    $("#engin_name").text(engininfo.name);
                }
                $("#shimoney").text(data.shimoney);
                $("#piao_kai_fee").text(data.piao_kai_fee);
                $("#kai_piaotype_name").text(data.kai_piaotype_name);
                if(shiinfo){
                    $("#shi_rate").text(shiinfo.rate);
                }
                $("#yifufee").text(data.yifufee);
                $("#money").text(data.money);
                $("#money_da").text(data.money_da);
                $("#fukuanci").text(data.fukuanci);
                $("#incdaotype").text(data.incdaotype);
                $("#gonger").text(data.gonger);
                $("#bankname").text(data.bankname+'（'+data.banknum+'）');
                $("#flowuser").text(data.flowuser);
                $("#flowdept").text(data.flowdept);
                $("#created_at_ymd").text(data.created_at_ymd);




                var files = res.data.files;
                var fileStr = '';
                for (var mmm in files){
                    fileStr += '<div>'+files[mmm].name+'</div>';
                }
                $("#filesinfo").html(fileStr);


                var shenlog = res.data.billinfo.shenlog;

                for (var key in shenlog){
                    if(key == 0 && shenlog[key].name == '发起流程'){
                        continue;
                    }
                    var str = '';
                    str += '<tr>';
                    str += ' <td>'+shenlog[key].name+'</td>';
                    str += '<td colspan="3" style="text-align: left">';
                    str += '<div>审核意见：'+shenlog[key].explain+'</div>';

                    str += '<div>';

                    if(shenlog[key].created_user_gang){
                        str += ' <span>'+shenlog[key].created_user_gang+'：</span>';
                    }else{
                        str += ' <span>审核人：</span>';
                    }

                    if(shenlog[key].qian){
                        str += '<img class="qianming" src="'+get_file_complete(shenlog[key].qian)+'" />';
                    }else{
                        str += '<span>'+shenlog[key].created_user+'</span>';
                    }
                    str += '<span style="float: right">日期：'+shenlog[key].created_at+'</span>';
                    str += '</div>';


                    str += '</td>';
                    str += '</tr>';
                    $(".dantab tbody").append(str);
                }
                render_from();
            }
        });
    });




    function print_flow_dan(){
        $("#exportword_content").printArea();
    }

</script>
</body>
</html>




